package com.wzcl.app.model.vo;

import com.wzcl.app.dao.model.CourseTeacher;
import com.wzcl.app.model.common.WZCL;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;

import java.util.Map;

@EqualsAndHashCode(callSuper = false)
@Data
public class CourseTeacherVo extends BaseVo {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty(name = "课程Id")
    private Integer courseId;

    @ApiModelProperty(name = "用户")
    private Integer userId;

    @ApiModelProperty(name = "老师名字")
    private String name;

    @ApiModelProperty(name = "老师联系电话")
    private String phone;

    @ApiModelProperty(name = "头像")
    private String headIcon;

    @ApiModelProperty(name = "职位")
    private Integer  position;
    private String  positionStr;

    private CourseTeacherVo() {
    }

    public static CourseTeacherVo create(CourseTeacher courseTeacher){
        CourseTeacherVo courseTeacherVo = new CourseTeacherVo();
        BeanUtils.copyProperties(courseTeacher,courseTeacherVo);
        courseTeacherVo.translationValueStr();
        return courseTeacherVo;
    }

    @Override
    public void translationValueStr() {
        Map<String, Map<Integer, String>> map = getTranslationMap();
        this.positionStr = map.get(WZCL.GROUP_NAME.TEACHER_POSITION).get(this.position);
    }

    @Override
    public void processResources() {

    }
}
